/*
 * 版权所有 (c) 2022-2099 TBIT。保留所有权利。
 */

package com.tbit.uqbike.service.business.impl;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tbit.uqbike.object.pojo.MachineOccupy;
import com.tbit.uqbike.service.business.MachineOccupyService;
import com.tbit.uqbike.webmanager.dao.core.MachineOccupyDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

/**
 * @author <a href="mailto:li.yao@tbit.com.cn">yao</a>
 * @version 4.2.0
 * @since 2024/9/12 16:41
 */
@Service
public class MachineOccupyServiceImpl implements MachineOccupyService {

    @Resource
    private MachineOccupyDao machineOccupyDao;

    @Override
    public List<MachineOccupy> getByMachineIds(List<Integer> machineIds) {
        return CollUtil.isEmpty(machineIds) ?
                Collections.emptyList() :
                machineOccupyDao.selectList(Wrappers.<MachineOccupy>lambdaQuery().in(MachineOccupy::getMachineId, machineIds));
    }
}
